/**
 * 2018年11月27日下午1:12:55
 * @author 谢进财
 */
package com.baihang.project.ds.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baihang.framework.controller.BaseController;
import com.baihang.project.ds.service.TiShiService;

/**
 * 提示管理
 *
 */
@Controller
@RequestMapping("/tishi")
public class TiShiController extends BaseController {
	@Autowired
	private TiShiService service;
	
	@RequestMapping
	public String index() {
				
		return "/project/ds/tishi/index";
	}
	
	@RequestMapping(value ="/getGrid", produces="application/json;charset=UTF-8")
	@ResponseBody
	public String getGrid(int page,int pagesize,String sortname,String sortorder) {
		String grid = service.getGrid(page,pagesize,sortname,sortorder);
		//System.out.println(grid);
		return grid;
	}
	
	@RequestMapping(value ="/saveGrid", produces="application/json;charset=UTF-8")
	@ResponseBody
	public String saveGrid(String json) {
		String result ="true";
		if(!service.saveGrid(json)) {
			result="false";
		}		
		return String.format("{\"result\":\"%s\"}", result);
	}
}
